home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / z / zeus2.dms / zeus2.adf / Developers / Include / libraries / Pipeline.h < prev    next >
C/C++ Source or Header  |  1995-07-04  |  23KB  |  916 lines

  1. #ifndef LIBRARIES_PIPELINE_H
  2. #define LIBRARIES_PIPELINE_H
  3.  
  4. /*
  5. ** $VER: zeus.h 37.0 (12.01.94)
  6. **       ____________
  7. **      (           / ___  __ __  ____
  8. **       \_____    / / _/ / // / /___/
  9. **            /   / / /  / // / //__
  10. **           /   / / _/ / // / /__ /
  11. **          /   / / /  / (/ / ___//
  12. **         /   / /__/ (____/ /___/
  13. **        /   /_____
  14. **       /          \
  15. **      /____________)  bulletin board system
  16. ** 
  17. ** Useful definitions for the zeus.library
  18. **
  19. ** (C) Copyright 1992-1994 Alex May and Nick Loman
  20. ** All rights reserved
  21. **
  22. */
  23.  
  24. #ifndef EXEC_TYPES_H
  25. #include <exec/types.h>
  26. #endif
  27.  
  28. #ifndef EXEC_LISTS_H
  29. #include <exec/lists.h>
  30. #endif
  31.  
  32. #ifndef EXEC_NODES_H
  33. #include <exec/nodes.h>
  34. #endif
  35.  
  36. #ifndef EXEC_SEMAPHORES_H
  37. #include <exec/semaphores.h>
  38. #endif
  39.  
  40. #ifndef _TIME_H
  41. #include <time.h>
  42. #endif
  43.  
  44. #ifndef DOS_DOSEXTENS_H
  45. #include <dos/dosextens.h>
  46. #endif
  47.  
  48. /*
  49. ** The function description structure
  50. */
  51.  
  52. struct    fdfunc
  53. {
  54.     UBYTE        *command;
  55.     long        (*function)( APTR );
  56.     APTR        next;            /* Private - set to NULL and do not reference! */
  57.     ULONG        flags;
  58. };
  59.  
  60. #define    FD_ASYNC            0x00000001
  61. #define    FD_NEEDLINE        0x00000002
  62.  
  63. /**********************************************************************/
  64. /*            The structure passed to the XPandCC functions           */
  65. /**********************************************************************/
  66.  
  67. struct CCArgs
  68. {
  69.     struct    Line    *Line;
  70.     ULONG                 CC;
  71.     ULONG                 MaxLen;
  72.     UBYTE                *Buffer;
  73.     UBYTE                 Args[40];
  74.     UBYTE                 Format[30];
  75. };
  76.  
  77. /**********************************************************************/
  78. /*                     Defines for the user flags                     */
  79. /**********************************************************************/
  80.  
  81. #define    UF_MORE            0x00000001
  82. #define    UF_EXPERT        0x00000002
  83. #define    UF_HOTKEYS        0x00000004
  84. #define    UF_NO8BIT        0x00000008
  85. #define    UF_VALIDATED    0x00000010
  86. #define    UF_CLRSCR        0x00000020
  87. #define    UF_LOGUSER        0x00000040
  88. #define    UF_ANSICOLR        0x00000080        /* Was UF_NOANSI */
  89. #define    UF_CRLF            0x00000100
  90. #define    UF_VALID            0x00000200
  91. #define    UF_WANTRIP        0x00000400
  92. #define    UF_DELETED        0x00000800
  93. #define    UF_AMIGAANSI    0x00001000
  94. #define    UF_PROTECTED    0x00002000
  95. #define    UF_NORESTRICT    0x00004000
  96. #define    UF_ANSIPOS        0x00008000
  97. #define    UF_ANSICOMP        0x00010000
  98. #define    UF_ANIMPROMPTS    0x00020000
  99. #define    UF_ANSIMUSIC    0x00040000
  100.  
  101. #define    UF_USEANSI        (UF_ANSICOLR|UF_ANSIPOS|UF_ANSICOMP)
  102.  
  103. /**********************************************************************/
  104. /*          Structures involved in the user list traversing           */
  105. /**********************************************************************/
  106.  
  107. struct    UserIdx
  108. {
  109.     UBYTE                 Name[40];
  110.     UBYTE                 Alias[40];
  111.     ULONG                 DataPos;
  112. };
  113.  
  114. #define    KEY_ALPHAFORWARD        0x0001
  115. #define    KEY_ALPHAREVERSE        0x0002
  116. #define    KEY_CHRONOFORWARD        0x0003
  117. #define    KEY_CHRONOREVERSE        0x0004
  118.  
  119. struct    UserKey
  120. {
  121.     struct    UserIdx    *uk_Current;        /* The current Index structure     */
  122.  
  123.     /* Data beyond this point is private and subject to change */
  124. };
  125.  
  126. /**********************************************************************/
  127. /*                        Main User structure                         */
  128. /**********************************************************************/
  129.  
  130. struct    User
  131. {
  132.     UBYTE                 ur_Name[40];
  133.     UBYTE                 ur_Alias[40];
  134.     UBYTE                 ur_Password[20];
  135.     UBYTE                 ur_VoicePhone[20];
  136.     UBYTE                 ur_DataPhone[20];
  137.     UBYTE                 ur_Street[40];
  138.     UBYTE                 ur_Town[20];
  139.     UBYTE                 ur_County[20];
  140.     UBYTE                 ur_PostCode[12];
  141.     UBYTE                 ur_Country[20];
  142.  
  143.     long                 ur_FirstCall;
  144.     long                 ur_LastCall;
  145.     ULONG                 ur_LastBaudRate;
  146.     ULONG                 ur_Flags;
  147.  
  148.     UBYTE                 ur_RIPfsz;
  149.     UBYTE                 ur_LogOffCode;        /* See LO_* defines */
  150.     
  151.     UWORD                 ur_Expire;                /* Number of days from first call the user may logon */
  152.  
  153.     long                 ur_Credit;
  154.  
  155.     UWORD                 ur_MinsLeft;
  156.     UWORD                 ur_NumCalls;
  157.     UWORD                 ur_MaxCallsPerDay;
  158.     UWORD                 ur_MaxMinsPerCall;
  159.     UWORD                 ur_MaxMinsPerDay;
  160.     
  161.     UWORD                 ur_DOB_Year;                /* Date of birth */
  162.     UBYTE                 ur_DOB_Mon;
  163.     UBYTE                 ur_DOB_Day;
  164.  
  165.     UBYTE                 ur_Access;
  166.     UBYTE                 ur_Computer;
  167.     UBYTE                 ur_ScrWidth;
  168.     UBYTE                 ur_ScrHeight;
  169.     UBYTE                 ur_MenuSet;
  170.     UBYTE                 ur_Language;
  171.     UBYTE                 ur_CallsToday;    
  172.     UBYTE                 ur_Gender;
  173. };
  174.  
  175. /*
  176. ** Defines for ur_Gender
  177. */
  178.  
  179. #define    GEN_UNKNOWN        0
  180. #define    GEN_MALE            1
  181. #define    GEN_FEMALE        2
  182.  
  183. /*
  184. ** Defines for ur_LogOffCode
  185. */
  186.  
  187. #define    LO_NORMAL        0
  188. #define    LO_INACTIVE        1
  189. #define    LO_BOOTED        2
  190. #define    LO_NOCARRIER    3
  191. #define    LO_NOTIME        4
  192.  
  193. /*
  194. ** Flags for reading
  195. */
  196.  
  197. #define    IR_RAW            0x00000001
  198. #define    IR_SECRET        0x00000002
  199. #define    IR_NOSHOW        0x00000004
  200. #define    IR_ONLYCHARS    0x00000008
  201. #define    IR_ONLYOPTS        0x00000010
  202. #define    IR_ONLYNUMS        0x00000020
  203. #define    IR_ONLYALPHA    0x00000040
  204. #define    IR_MAKEUPPER    0x00000080        /* Make all characters uppercase */
  205. #define    IR_MAKELOWER    0x00000100        /* Make all characters lowercase */
  206. #define    IR_DEFAULTSTR    0x00000200        /* Use default string                */
  207. #define    IR_NOWAIT        0x00000400        /* Return immediatly                    */
  208. #define    IR_ISMENU        0x00000800        /* Allow command stacking             */
  209. #define    IR_NONEWLINE    0x00001000        /* Do not append a new line        */
  210. #define    IR_XOPTS            0x00002000
  211. #define    IR_MAKENICE        0x00004000
  212. #define    IR_HISTORY        0x00008000
  213. #define    IR_ADDHIST        0x00010000
  214. #define    IR_NOCD            0x00020000        /* Don't check for carrier loss    */
  215. #define    IR_EOLRET        0x00040000        /* Return when buffer is full    */
  216. #define    IR_CHECKMSGS    0x00080000        /* Return when line message(s) are available */
  217.  
  218. /**********************************************************************/
  219. /*                   Defines for the dc_Flags field                   */
  220. /**********************************************************************/
  221.  
  222. #define    DCF_OPENDEV        0x00000001
  223. #define    DCF_SCRIPT        0x00000002
  224. #define    DCF_USEDSR        0x00000004
  225. #define    DCF_CHECKCAR    0x00000008
  226. #define    DCF_USERADBOOG    0x00000010
  227. #define    DCF_FLOATBAUD    0x00000020
  228.  
  229. /**********************************************************************/
  230. /*                      The device config struct                      */
  231. /**********************************************************************/
  232.  
  233. struct    Dev_Cfg
  234. {
  235.     UBYTE                     dc_Device[40];
  236.     ULONG                     dc_Unit;
  237.     ULONG                     dc_DevBuffSize;
  238.     ULONG                     dc_Baud;
  239.     ULONG                     dc_BrkTime;
  240.     ULONG                     dc_Flags;
  241.     UBYTE                     dc_Ring[40];
  242.     UBYTE                     dc_NoCon[40];
  243.     UBYTE                     dc_Con[40];
  244.     UBYTE                     dc_Answer[40];
  245.     UBYTE                     dc_HangUp[40];
  246.     UBYTE                     dc_Init[40];
  247.     UBYTE                     dc_DataLen;
  248.     UBYTE                     dc_StopBits;
  249.     UBYTE                     dc_Handshake;
  250.     UBYTE                     dc_Parity;
  251. };
  252.  
  253. /*
  254. ** IEMSI structure
  255. **
  256. ** Only valid if ( line->le_TermCaps & DOES_IEMSI )
  257. */
  258.  
  259. struct    ie_info
  260. {
  261.     UBYTE        *ie_Buff;        /* Buffer containing data sent from user */
  262.     UBYTE        *ie_Name;        /* These fields are offsets into ie_buff */
  263.     UBYTE        *ie_Alias;
  264.     UBYTE        *ie_Location;
  265.     UBYTE        *ie_DataNum;
  266.     UBYTE        *ie_VoiceNum;
  267.     UBYTE        *ie_Password;
  268.     UBYTE        *ie_BDate;
  269.     UBYTE        *ie_CrtDef;
  270.     UBYTE        *ie_Protocols;
  271.     UBYTE        *ie_Capabs;
  272.     UBYTE        *ie_Requests;
  273.     UBYTE        *ie_Software;
  274.     UBYTE        *ie_TransTab;
  275. };
  276.  
  277. /*
  278. ** The line structure as obtained by GetLine()
  279. */
  280.  
  281. struct    Line
  282. {
  283.     struct    User            *le_User;                /* Pointer to user online or NULL                 */
  284.     struct    Dev_Cfg        *le_DevCfg;                /* Pointer to line's device config or NULL     */
  285.     ULONG                         le_Number;                /* Number of this line                                */
  286.     ULONG                         le_RealBaud;            /* Read baud rate (or NULL for local)            */
  287.     BOOL                         le_Carrier;            /* Carrier present if TRUE                            */
  288.     UBYTE                        *le_Status;                /* Status string                                        */
  289.     struct    Language        *le_Lang;                /* Current language                                    */
  290.     ULONG                         le_MinsOnline;        /* Minutes line has been active                    */
  291.     UWORD                         le_ConnectFlags;        /* Connection flags (See CD_* defines)            */
  292.     UBYTE                        *le_Anim;                /* ANSI Prompt Animation Pointer                    */
  293.     UWORD                         le_AnimPos;            /* Position in the ANSI Anim                        */
  294.     UWORD                         le_Type;
  295.     UWORD                         le_TermCaps;            /* Terminal capabilities                            */
  296.     struct    ie_info        *le_IEmsi;                /* IEMSI information                                    */
  297.     UWORD                         le_Inactive;            /* Number of seconds since user last pressed a key */
  298.     ULONG                         le_LockBaud;            /* Computer -> Modem Baud                             */
  299.     struct    List              le_Access;                /* Access restriction list                            */
  300.     UWORD                         le_Flags;
  301.     UBYTE                        *le_TrPtrI;                /* Pointer to current input translation table or NULL (usually points to le->le_TransI) */
  302.     UBYTE                        *le_TrPtrO;                /* Pointer to current output translation table or NULL (usually points to le->le_TransO) */
  303.     UBYTE                         le_TransI[256];        /* Input translation */
  304.     UBYTE                         le_TransO[256];        /* Output translation */
  305. };
  306.  
  307. /*
  308. ** Defines for le->le_Type
  309. **
  310. ** le->le_DevCfg is only valid for TYPE_SERIAL
  311. */
  312.  
  313. #define    TYPE_LOCAL        0
  314. #define    TYPE_SERIAL        1
  315.  
  316. #define    TYPE_ACCESS        0xFFFF
  317.  
  318. /*
  319. ** Defines for the le->le_TermCaps field
  320. */
  321.  
  322. #define    DOES_ANSI        0x0001
  323. #define    DOES_RIP            0x0002
  324. #define    DOES_IEMSI        0x0004
  325. #define    DOES_8BIT        0x0008        /* For forcing 8 bit */
  326.  
  327. /*
  328. ** Flags for le->le_Flags
  329. */
  330.  
  331. #define    LE_NOTAKETIME    0x0001
  332.  
  333. /*
  334. ** The flags that can be obtained by GetLineStatus()
  335. */
  336.  
  337. #define    LN_OPEN            0x00000001            /* Redundant                                    */
  338. #define    LN_LISTEN        0x00000002            /* Redundant                                    */
  339. #define    LN_DIE            0x00000004            /* Pending kill line                            */
  340. #define    LN_ALLOWBRK        0x00000008
  341. #define    LN_WRITING        0x00000010            /* Writing data                                 */
  342. #define    LN_READING        0x00000020            /* Reading data                                 */
  343. #define    LN_INDOOR        0x00000040            /* In a CLIDoor                                 */
  344. #define    LN_DEAD            0x00000080
  345. #define    LN_DONECP        0x00000100            /* Redundant                                    */
  346. #define    LN_KILLSCR        0x00000200            /* Pending kill script                         */
  347. #define    LN_DEVOPEN        0x00000400            /* Device is open (TYPE_SERIAL only)     */
  348. #define    LN_INCHAT        0x00000800            /* In chat                                         */
  349. #define    LN_STOPCHAT        0x00001000            /* Pending chat end                            */
  350. #define    LN_LOCAL            0x00002000            /* Line is local                                */
  351. #define    LN_DYING            0x00004000            /* Line has received LN_DIE                */
  352. #define    LN_CNTMINS        0x00008000            /* Counting minutes online                    */
  353. #define    LN_ONLINE        0x00010000            /* Line is Online                                */
  354. #define    LN_BOOTUSER        0x00020000            /* Boot user off!                                */
  355. #define    LN_OUTOFF        0x00040000            /* Output is turned off                     */
  356. #define    LN_RIPENABLED    0x00080000            /* RIP is enabled                             */
  357. #define    LN_LOCALINPUT    0x00100000            /* Last input came from local                */
  358. #define    LN_SERIALOFF    0x00200000            /* Serial output is disabled                 */
  359. #define    LN_NOCD            0x00400000
  360. #define    LN_NOCHAT        0x00800000
  361. #define    LN_NOSERIN        0x01000000
  362.  
  363. struct    P_Sem
  364. {
  365.     struct    SignalSemaphore     ps_Sem;
  366.     UBYTE                                 ps_Name[10];
  367.     void                                *ps_Data;
  368. };
  369.  
  370. struct    P_Sems
  371. {
  372.     struct    P_Sem        Func_Sem;
  373.     struct    P_Sem        User_Sem;
  374.     struct    P_Sem        Prog_Sem;
  375.     struct    P_Sem        Line_Sem;
  376.     struct    P_Sem        Dead_Sem;
  377.     struct    P_Sem        GFnc_Sem;
  378. };
  379.  
  380. /**********************************************************************/
  381. /*               Saved Data for recording system stats                */
  382. /**********************************************************************/
  383.  
  384. struct SavedData
  385. {
  386.     ULONG    sd_Calls;
  387.     ULONG    sd_LocalCalls;
  388.     ULONG    sd_CallsToday;
  389.  
  390.     ULONG    sd_Users;
  391.     ULONG    sd_LogIns[24];
  392. };
  393.  
  394. /**********************************************************************/
  395. /*                      Various System Variables                      */
  396. /**********************************************************************/
  397.  
  398. struct SysVars
  399. {
  400.     UWORD        sv_UserIdxBuff;
  401.     UWORD        sv_CarChkInterval;
  402.     UWORD        sv_InacTime;
  403.     UBYTE        sv_SystemName[60];
  404.     UBYTE        sv_SystemLocation[60];
  405.     UBYTE        sv_SysOpName[40];
  406.     UWORD        sv_LastCalls;
  407.     UWORD        sv_BufferedText;
  408.     ULONG        sv_MaxTextSize;
  409.     ULONG        sv_Flags;
  410. };
  411.  
  412. #define        SVF_COUNTLOCAL        0x00000001
  413.  
  414. /**********************************************************************/
  415. /*                               Paths                                */
  416. /**********************************************************************/
  417.  
  418. struct Paths
  419. {
  420.     UBYTE        User[50];
  421.     UBYTE        Text[50];
  422.     UBYTE        Scripts[50];
  423.     UBYTE        Mail[50];
  424.     UBYTE        File[50];
  425.     UBYTE        Doors[50];
  426.     UBYTE        Logs[50];
  427.     UBYTE        Inbound[50];
  428.     UBYTE        Outbound[50];
  429. };
  430.  
  431. /*
  432. ** Language config as found in Shared->LangList
  433. */
  434.  
  435. struct    Language
  436. {
  437.     struct    Node         Node;
  438.     APTR                     Lang;
  439.     UBYTE                    *Name;
  440.     ULONG                     Number;
  441.     UBYTE                     Tran[16];
  442.     UBYTE                    *Press_Return;
  443.     UBYTE                    *YesNo;
  444.     UBYTE                    *YesNoCont;
  445.     UBYTE                    *Def_Yes;
  446.     UBYTE                    *Def_No;
  447.     UBYTE                    *Yes;
  448.     UBYTE                    *No;
  449.     UBYTE                    *Cont;
  450.     UBYTE                    *PrivChar;
  451.     UBYTE                    *CC_Yes;
  452.     UBYTE                    *CC_No;
  453.     UBYTE                    *CC_On;
  454.     UBYTE                    *CC_Off;
  455.     UBYTE                    *CC_StrForm;
  456.     UBYTE                    *CC_NumForm;
  457.     UBYTE                    *CC_TimeForm;
  458.     UBYTE                    *More;
  459. };
  460.  
  461. /*
  462. ** Last caller structure for Shared->LastCalls
  463. */
  464.  
  465. struct    LastCaller
  466. {
  467.     struct    Node            Node;            /* For linkage                                                        */
  468.     UWORD                        Line;            /* Line number                                                        */
  469.     UBYTE                        Name[40];    /* Users name                                                        */
  470.     time_t                    LogOn;        /* LogOn time                                                        */
  471.     time_t                    LogOff;        /* LogOff time                                                        */
  472.     struct    User            User;            /* _Copy_ of the user structure as it was at logoff    */
  473. };
  474.  
  475. /*
  476. ** Information from Zeus.key
  477. */
  478.  
  479. struct    KeyInfo
  480. {
  481.     struct    DateStamp    Created;        /* DateStamp of Key creation     */
  482.     ULONG                        Serial;        /* Zeus serial number            */
  483.     UBYTE                        Name[40];    /* Name of registered sysop    */
  484. };
  485.  
  486. /**********************************************************************/
  487. /*                     The shared data structure                      */
  488. /**********************************************************************/
  489.  
  490. struct SharedData
  491. {
  492.     struct    DosLibrary            *DOSBase;
  493.     struct    GfxBase                *GfxBase;
  494.     struct    IntuitionBase        *IntuitionBase;
  495.     struct    Library                *DiskfontBase;
  496.     struct    Library                *GadToolsBase;
  497.     struct    Library                *RexxSysBase;
  498.     struct    Library                *UtilityBase;
  499.     struct    Library                *WorkbenchBase;
  500.     struct    Library                *PipeUtilBase;
  501.  
  502.     ULONG                                 RsrcCount;        /* Private */
  503.  
  504.     struct    P_Sems                *Sems;            /* Private */
  505.     struct    SavedData             Saved;
  506.     struct    Process                *PipeProc;
  507.  
  508.     ULONG                                 HiLine;            /* High number of lines present*/
  509.     ULONG                                 Active;            /* Number of lines active */
  510.  
  511.     struct    Line_Node          **ln_array;        /* Private */
  512.     
  513.     ULONG                                 Users;            /* How many users */
  514.     
  515.     struct    SysVars                *SysVars;        /* System variables */
  516.     struct    Paths                    *Paths;            /* Paths config */
  517.     struct    List                     LangList;        /* List of defined languages */
  518.  
  519.     BOOL                                 SysOp;            /* TRUE - SysOp available for chat */
  520.     
  521.     struct    List                     LastCalls;        /* Last callers of this session */
  522.     UWORD                                 NumLast;        /* Number of last callers in list */
  523.     
  524.     UWORD                                 Ver_PL;            /* Version of Pipeline  */
  525.     UWORD                                 Rev_PL;            /* Revision of Pipeline */
  526.     
  527.     long                                 Globals;        /* Number of global commands defined */
  528.     
  529.     struct    SignalSemaphore    *LCSem;            /* Semaphore for the last calls list - use it! */
  530.     
  531.     struct    List                     MSList;            /* Menu Set list */
  532.     struct    SignalSemaphore     MSSem;            /* Menu Set semaphore */
  533.     
  534.     struct    List                     BanList;        /* Banned user wildcards */
  535.     struct    SignalSemaphore     BanSem;
  536.  
  537.     struct    KeyInfo                *KeyInfo;        /* Info from Zeus.key */
  538.  
  539.     struct    List                     TransList;        /* Character translations */
  540. };
  541.  
  542. /*
  543. ** Flags for writing
  544. */
  545.  
  546. #define    WF_NOMORE            0x00000001        /* No more prompts                */
  547. #define    WF_ISMENU            0x00000002        /* Is a menu                        */
  548. #define    WF_BREAK                0x00000004        /* Allow breaking                    */
  549. #define    WF_NOCOOK            0x00000010        /* Dont 'cook' the data            */
  550. #define    WF_SPECIALMORE        0x00000020        /* Return when screen is full    */
  551. #define    WF_USEMOREYN        0x00000040        /* Prompt is 'More Y/N'            */
  552. #define    WF_RIPONLY            0x00000080        /* Only display if RIP            */
  553. #define    WF_TXTONLY            0x00000100        /* Only display if not RIP        */
  554. #define    WF_USEMOREYNC        0x00000200        /* Prompt is 'More Y/N/C        */
  555. #define    WF_BUFFER            0x00000400        /* Buffer this file                */
  556. #define    WF_ISRIP                0x00001000        /* Is RIP graphics                */
  557. #define    WF_NORESET            0x00002000        /* Don't send RIP reset code    */
  558. #define    WF_NOEXPAND            0x00004000        /* Don't expand control codes    */
  559. #define    WF_LOCALDIR            0x00008000
  560. #define    WF_NOCD                0x00010000
  561.  
  562. /**********************************************************************/
  563. /*                  The structure passed to ReadLine                  */
  564. /**********************************************************************/
  565.  
  566. struct ReadVars
  567. {
  568.     long         LineNum;
  569.     UBYTE        *Buff;
  570.     UBYTE        *Opts;
  571.     ULONG         MaxLen;
  572.     ULONG         MinLen;
  573.     ULONG         Flags;
  574. };
  575.  
  576. /**********************************************************************/
  577. /*                  Structure used in chat routines                   */
  578. /**********************************************************************/
  579.  
  580. struct    ChatChar
  581. {
  582.     UBYTE        ch;
  583.     UBYTE        type;
  584. };
  585.  
  586. #define    TYPE_USER    0x00
  587. #define    TYPE_SYSOP    0x01
  588. #define    TYPE_FINISH    0x02
  589. #define    TYPE_START    0x03
  590.  
  591. /**********************************************************************/
  592. /*             Structures and defines for Control Gadgets             */
  593. /**********************************************************************/
  594.  
  595. struct    ConMsg
  596. {
  597.     struct    Message        cm_Msg;
  598.     UWORD                        cm_GadID;
  599.     UWORD                        cm_Action;
  600. };
  601.  
  602. #define    GAD_SELECT        1        /* Codes in ConMsg->cm_Action */
  603. #define    GAD_QUIT            2
  604. #define    WIN_ICONIFY        3
  605.  
  606. /*
  607. ** Structures and defines for use when transfering files
  608. */
  609.  
  610. #define    XFER_SEND                1        /* Mode options */
  611. #define    XFER_RECEIVE            2
  612.  
  613. #define    FILE_ABORTED            0        /* Codes found in XferInfoNode->Status */
  614.  
  615. #define    FILE_SENT                1
  616. #define    FILE_PARTIAL_SEND        2
  617.  
  618. #define    FILE_RECEIVED            3
  619. #define    FILE_PARTIAL_RECEIVE    4
  620.  
  621. struct    XferInfo
  622. {
  623.     struct    List         Send;                /* List of XferInfoNodes        */
  624.     struct    List         Recv;                /* List of XferInfoNodes        */
  625.     struct    Line        *le;
  626.     struct    XprProto    *xpr;
  627.  
  628.     ULONG                     FilesSent;            /* Number of files sent            */
  629.     ULONG                     FilesRcvd;            /* Number of files received    */
  630.  
  631.     ULONG                     SendCPS;            /* Average send cps                */
  632.     ULONG                     RecvCPS;            /* Average receive cps            */
  633.     ULONG                     SendBytes;            /* Number of bytes sent            */
  634.     ULONG                     RecvBytes;            /* Number of bytes received    */
  635.     ULONG                     SendErrs;            /* Number of send errors        */
  636.     ULONG                     RecvErrs;            /* Number of receive errors    */
  637.     ULONG                     SendTimeOuts;        /* Number of send timeouts        */
  638.     ULONG                     RecvTimeOuts;        /* Number of receive timeouts    */
  639.     ULONG                     Mode;                /* Initial mode                    */
  640. };
  641.  
  642. struct    XferInfoNode
  643. {
  644.     struct    Node        Node;
  645.     UBYTE                    Filename[108];
  646.     ULONG                    Length;                /* Length of full file (or -1 if not known) */
  647.     ULONG                    Xferd;                /* Amount of bytes transfered */
  648.     UWORD                    Status;                /* Final status of file */
  649.     ULONG                    Cps;                    /* Chars per second */
  650. };
  651.  
  652. /*
  653. ** Defines for Pipe functions
  654. */
  655.  
  656. #define        PIPE_READ        1
  657. #define        PIPE_WRITE        2
  658. #define        PIPE_EOF            1
  659.  
  660. #define        PIPE_REQ_WRITE        1                /* Request Types */
  661. #define        PIPE_REQ_READ        2
  662. #define        PIPE_REQ_ABORT        3
  663.  
  664. /*
  665. ** Defines for LineOutputMode
  666. */
  667.  
  668. #define        OUTPUT_ON        0
  669. #define        OUTPUT_OFF        1
  670.  
  671. /*
  672. ** Bulletin related structures/defines
  673. */
  674.  
  675. struct    Bulletin
  676. {
  677.     LONG        Number;                /* Number of bulletin    */
  678.     UBYTE        Name[50];            /* Name of bulletin        */
  679.     UBYTE        Key[10];                /* Key                        */
  680.     UBYTE        Filename[100];        /* Filename                    */
  681.     time_t    Created;                /* Creation date            */
  682.     time_t    Expires;                /* Expiry date or -1        */
  683.  
  684.     UBYTE        MinAcc;                /* Minimum access needed */
  685.     UBYTE        MaxAcc;                /* Maximum access needed */
  686. };
  687.  
  688. struct    BltnNode
  689. {
  690.     struct    Node            Node;    /* Node.ln_Name points to Bltn.Key */
  691.     struct    Bulletin        Bltn;
  692. };
  693.  
  694. /*
  695. ** Tags for ReadLineTags and ReadLineTagList
  696. */
  697.  
  698. #define    RLT_Opts                (TAG_USER+1)
  699. #define    RLT_MaxLen            (TAG_USER+2)
  700. #define    RLT_MinLen            (TAG_USER+3)
  701. #define    RLT_Flags            (TAG_USER+4)
  702. #define    RLT_TimeOut            (TAG_USER+5)
  703.  
  704. #define    RLT_Raw                (TAG_USER+6)
  705. #define    RLT_Secret            (TAG_USER+7)
  706. #define    RLT_NoShow            (TAG_USER+8)
  707. #define    RLT_OnlyChars        (TAG_USER+9)
  708. #define    RLT_OnlyOpts        (TAG_USER+10)
  709. #define    RLT_OnlyNums        (TAG_USER+11)
  710. #define    RLT_OnlyAlpha        (TAG_USER+12)
  711. #define    RLT_MakeUpper        (TAG_USER+13)
  712. #define    RLT_MakeLower        (TAG_USER+14)
  713. #define    RLT_DefaultStr        (TAG_USER+15)
  714. #define    RLT_NoWait            (TAG_USER+16)
  715. #define    RLT_IsMenu            (TAG_USER+17)
  716. #define    RLT_NoNewLine        (TAG_USER+18)
  717.  
  718. #define    RLT_XOpts            (TAG_USER+19)
  719. #define    RLT_NoCD                (TAG_USER+20)
  720. #define    RLT_MakeNice        (TAG_USER+21)
  721.  
  722. #ifndef USE_DOORLIB
  723.  
  724. /*
  725. ** Prototypes for pl.lib & plnb.lib
  726. */
  727.  
  728. long LPuts( long, UBYTE *, ULONG );
  729.  
  730. #else
  731.  
  732. /*
  733. ** Prototypes for zdoor.lib & zdoornb.lib
  734. */
  735.  
  736. long LPuts( UBYTE * );
  737.  
  738. #endif
  739.  
  740. /*
  741. ** Watchers
  742. */
  743.  
  744. struct    WatcherMsg
  745. {
  746.     struct    Message         Msg;
  747.     long                         Code;
  748.     long                         Result;
  749. };
  750.  
  751. #define    WM_OFFLINE        0
  752. #define    WM_ONLINE        1
  753. #define    WM_RIPON            2
  754. #define    WM_RIPOFF        3
  755. #define    WM_ICONIFY        4
  756. #define    WM_UNICONIFY    5
  757. #define    WM_USERON        6
  758. #define    WM_NEWSTATUS    7
  759. #define    WM_TOFRONT        8
  760. #define    WM_TOBACK        9
  761.  
  762. #define    WR_MOVETOTOP    1
  763.  
  764. /*
  765. ** Watcher function key structures/defines
  766. */
  767.  
  768. #define    FKEY_EXEC        0                /* Types for FKey->Type */
  769. #define    FKEY_TEXT        1
  770.  
  771. struct    FKey
  772. {
  773.     char        Data[60];
  774.     UWORD        Type;
  775. };
  776.  
  777. struct    WatcherSem
  778. {
  779.     struct    SignalSemaphore    ws_Sem;
  780.     UBYTE                                ws_Name[20];
  781.     struct    FKey                    ws_Keys[20];
  782.     UWORD                                ws_OpenCnt;
  783. };
  784.  
  785. #define    WATCHSEMNAME        "WATCHKEYSEM"
  786.  
  787. /*
  788. ** Flags returned by GetConnectMode()
  789. */
  790.  
  791. #define    CD_ARQ        0x0001
  792. #define    CD_HST        0x0002
  793. #define    CD_SYNC        0x0004
  794. #define    CD_V42BIS    0x0008
  795. #define    CD_LAPM        0x0010
  796. #define    CD_MNP        0x0020
  797. #define    CD_MNP5        0x0040
  798.  
  799. /*
  800. ** Menu Set Flags
  801. */
  802.  
  803. #define    MS_RIP            0x0001
  804. #define    MS_AMIGA            0x0002
  805. #define    MS_8BIT            0x0004
  806. #define    MS_ANSICOLR        0x0008
  807. #define    MS_NOMORE        0x0010
  808. #define    MS_ANSIPOS        0x0020
  809. #define    MS_ANSICOMP        0x0040
  810.  
  811. struct    MenuSet
  812. {
  813.     struct    Node         ms_Node;
  814.     UWORD                     ms_Number;
  815.     UBYTE                     ms_Name[50];
  816.     UWORD                     ms_Flags;
  817. };
  818.  
  819. struct    BanNode
  820. {
  821.     struct    MinNode     bn_Node;
  822.     UBYTE                     bn_Data[50];
  823. };
  824.  
  825. #define        LSC_PATHS            0x0001
  826. #define        LSC_SYSVARS            0x0002
  827. #define        LSC_LANGS            0x0004
  828. #define        LSC_MENUS            0x0008
  829. #define        LSC_BANNED            0x0010
  830. #define        LSC_COMPUTERS        0x0020
  831. #define        LSC_ALL                0xFFFF
  832.  
  833. #define        LSC_RET_OK                0
  834. #define        LSC_RET_DOSERR            1
  835. #define        LSC_RET_MEMERR            2
  836. #define        LSC_RET_NOZEUS            3
  837. #define        LSC_RET_OLDCFG            4
  838. #define        LSC_RET_NOCFG            5
  839. #define        LSC_RET_DEFLANGERR    6
  840. #define        LSC_RET_LANGERR        7
  841.  
  842. /*
  843. ** Structures and defines for Line access
  844. **
  845. ** These nodes are found in the line structure in the le_Access list
  846. */
  847.  
  848. struct    LineAcc
  849. {
  850.     struct    MinNode        Node;
  851.     UBYTE                        FHor, FMin;                /* From time                        */
  852.     UBYTE                        THor, TMin;                /* To time                            */
  853.     ULONG                        Flags;                    /* Flags - see ACC_* defines    */
  854.     ULONG                        MinBaud, MaxBaud;        /* Min/Max Baudrates                */
  855.     UBYTE                        MinAcc, MaxAcc;        /* Min/Max Access levels        */
  856. };
  857.  
  858. #define    ACC_LOGONS        0x00000001
  859. #define    ACC_MINBAUD        0x00000002
  860. #define    ACC_MAXBAUD        0x00000004
  861. #define    ACC_MINACCESS    0x00000008
  862. #define    ACC_MAXACCESS    0x00000010
  863.  
  864. #ifndef MAKE_ID
  865. #define MAKE_ID(a,b,c,d)    \
  866.     ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  867. #endif
  868.  
  869. #define    EDIT_ANSI        (-1)
  870. #define    EDIT_NOANSI        (-2)
  871.  
  872. struct    EditOpts
  873. {
  874.     struct    List        *History;
  875.     long                     Num;
  876.     UBYTE                    *Buff;
  877.     UBYTE                    *Work;
  878.     UBYTE                    *Opts;
  879.     UBYTE                    *XOpts;
  880.     ULONG                     MinLen;
  881.     ULONG                     MaxLen;
  882.     ULONG                     Flags;
  883. };
  884.  
  885. /*
  886. ** ZSegs - Returned by ZLoadSeg
  887. */
  888.  
  889. struct    ZSegs
  890. {
  891.     struct    Segment    *Seg;            /* May be NULL */
  892.     BPTR                     SegList;
  893. };
  894.  
  895. /*
  896. ** TransNode - Found on Shared->TransList
  897. */
  898.  
  899. struct TransNode
  900. {
  901.     struct    Node            n;
  902.     UBYTE                        Tag[12];            /* Tag                             */
  903.     UBYTE                        Name[30];        /* Name of this translation */
  904.     UBYTE                        ITab[256];        /* Input table                     */
  905.     UBYTE                        OTab[256];        /* Output table                 */
  906. };
  907.  
  908. /*
  909. ** User ExtraData
  910. */
  911.  
  912. #define        ID_CTRI        MAKE_ID( 'C', 'T', 'R', 'I' )        /* Translation In  */
  913. #define        ID_CTRO        MAKE_ID( 'C', 'T', 'R', 'O' )        /* Translation Out */
  914.  
  915. #endif        /* LIBRARIES_PIPELINE_H */
  916.